home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-01-24 | 5.0 KB | 197 lines | [TEXT/MPS ] |
- ;
- ; File: Dictionary.a
- ;
- ; Contains: Dictionary Manager Interfaces
- ;
- ; Version: Technology: System 7.5
- ; Package: Universal Interfaces 2.2 in “MPW” on ETO #20
- ;
- ; Copyright: © 1984-1995 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- ; stack. Include the file and version information (from above)
- ; in the problem description and send to:
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__DICTIONARY__') = 'UNDEFINED' THEN
- __DICTIONARY__ SET 1
-
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- ; include 'ConditionalMacros.a' ;
-
- IF &TYPE('__FILES__') = 'UNDEFINED' THEN
- include 'Files.a'
- ENDIF
- ; include 'MixedMode.a' ;
- ; include 'OSUtils.a' ;
- ; include 'Memory.a' ;
- ; include 'Finder.a' ;
-
- ; Dictionary data insertion modes
- kInsert EQU 0 ; Only insert the input entry if there is nothing in the dictionary that matches the key.
- kReplace EQU 1 ; Only replace the entries which match the key with the input entry.
- kInsertOrReplace EQU 2 ; Insert the entry if there is nothing in the dictionary which matches the key.
- ; If there is already matched entries, replace the existing matched entries with the input entry.
-
- ; This Was InsertMode
- ; typedef short DictionaryDataInsertMode
-
- ; Key attribute constants
- kIsCaseSensitive EQU $10 ; case sensitive = 16
- kIsNotDiacriticalSensitive EQU $20 ; diac not sensitive = 32
-
- ; Registered attribute type constants.
- kNoun EQU -1
- kVerb EQU -2
- kAdjective EQU -3
- kAdverb EQU -4
-
- ; This Was AttributeType
- ; typedef SInt8 DictionaryEntryAttribute
- ; Dictionary information record
- DictionaryInformation RECORD 0
- dictionaryFSSpec ds FSSpec ; offset: $0 (0)
- numberOfRecords ds.l 1 ; offset: $46 (70)
- currentGarbageSize ds.l 1 ; offset: $4A (74)
- script ds.w 1 ; offset: $4E (78)
- maximumKeyLength ds.w 1 ; offset: $50 (80)
- keyAttributes ds.b 1 ; offset: $52 (82)
- filler ds.b 1 ; offset: $53 (83)
- sizeof EQU * ; size: $54 (84)
- ENDR
-
- ; typedef struct DictionaryInformation DictionaryInformation
- DictionaryAttributeTable RECORD 0
- datSize ds.b 1 ; offset: $0 (0)
- datTable ds.b 1 ; offset: $1 (1)
- sizeof EQU * ; size: $2 (2)
- ENDR
-
- ; typedef struct DictionaryAttributeTable DictionaryAttributeTable
- ; typedef DictionaryAttributeTable *DictionaryAttributeTablePtr
- ;
- ; pascal OSErr InitializeDictionary(const FSSpec *theFsspecPtr, SInt16 maximumKeyLength, SInt8 keyAttributes, ScriptCode script)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _InitializeDictionary
- move.w #$0500,d0
- dc.w $AA53
- EndM
- ELSE
- IMPORT_CFM_FUNCTION InitializeDictionary
- ENDIF
-
- ;
- ; pascal OSErr OpenDictionary(const FSSpec *theFsspecPtr, SInt8 accessPermission, SInt32 *dictionaryReference)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _OpenDictionary
- move.w #$0501,d0
- dc.w $AA53
- EndM
- ELSE
- IMPORT_CFM_FUNCTION OpenDictionary
- ENDIF
-
- ;
- ; pascal OSErr CloseDictionary(SInt32 dictionaryReference)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CloseDictionary
- move.w #$0202,d0
- dc.w $AA53
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CloseDictionary
- ENDIF
-
- ;
- ; pascal OSErr InsertRecordToDictionary(SInt32 dictionaryReference, ConstStr255Param key, Handle recordDataHandle, DictionaryDataInsertMode whichMode)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _InsertRecordToDictionary
- move.w #$0703,d0
- dc.w $AA53
- EndM
- ELSE
- IMPORT_CFM_FUNCTION InsertRecordToDictionary
- ENDIF
-
- ;
- ; pascal OSErr DeleteRecordFromDictionary(SInt32 dictionaryReference, ConstStr255Param key)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _DeleteRecordFromDictionary
- move.w #$0404,d0
- dc.w $AA53
- EndM
- ELSE
- IMPORT_CFM_FUNCTION DeleteRecordFromDictionary
- ENDIF
-
- ;
- ; pascal OSErr FindRecordInDictionary(SInt32 dictionaryReference, ConstStr255Param key, DictionaryAttributeTablePtr requestedAttributeTablePointer, Handle recordDataHandle)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _FindRecordInDictionary
- move.w #$0805,d0
- dc.w $AA53
- EndM
- ELSE
- IMPORT_CFM_FUNCTION FindRecordInDictionary
- ENDIF
-
- ;
- ; pascal OSErr FindRecordByIndexInDictionary(SInt32 dictionaryReference, SInt32 recordIndex, DictionaryAttributeTablePtr requestedAttributeTablePointer, Str255 recordKey, Handle recordDataHandle)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _FindRecordByIndexInDictionary
- move.w #$0A06,d0
- dc.w $AA53
- EndM
- ELSE
- IMPORT_CFM_FUNCTION FindRecordByIndexInDictionary
- ENDIF
-
- ;
- ; pascal OSErr GetDictionaryInformation(SInt32 dictionaryReference, DictionaryInformation *theDictionaryInformation)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetDictionaryInformation
- move.w #$0407,d0
- dc.w $AA53
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetDictionaryInformation
- ENDIF
-
- ;
- ; pascal OSErr CompactDictionary(SInt32 dictionaryReference)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _CompactDictionary
- move.w #$0208,d0
- dc.w $AA53
- EndM
- ELSE
- IMPORT_CFM_FUNCTION CompactDictionary
- ENDIF
-
- ENDIF ; __DICTIONARY__
-